package vip.xiaonuo.modular.manage.basemetadata.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.clickhouse.jdbc.ClickHousePreparedStatement;
import org.springframework.stereotype.Service;
import vip.xiaonuo.dbs.core.annotation.DataSource;
import vip.xiaonuo.modular.common.WdAnalysisConst;
import vip.xiaonuo.modular.manage.basemetadata.entity.BaseMetadata;
import vip.xiaonuo.modular.manage.basemetadata.mapper.BaseMetadataMapper;
import vip.xiaonuo.modular.manage.basemetadata.service.BaseMetadataService;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class BaseMetadataServiceImpl extends ServiceImpl<BaseMetadataMapper, BaseMetadata> implements BaseMetadataService {

    @Override
    @DataSource(name = WdAnalysisConst.CLICKHOUSE_DATASOURCE)
    public List<BaseMetadata> findByRecordId(String id) {
        QueryWrapper<BaseMetadata> queryWrapper= new QueryWrapper<>();
        queryWrapper.lambda().eq(BaseMetadata::getRecordId,id);
        List<BaseMetadata> baseMetadataList = this.list(queryWrapper);
        return baseMetadataList;
    }
}
